package aufgabe3_chat;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;


public class Chat_User_Administration {

	static Map<String, String> chat_user;
	Logger logger;
	
	
	public Chat_User_Administration(Logger logger){
		chat_user = new HashMap<String, String>();
		this.logger = logger;
	}
	
	public void add(String username, String adress){
		chat_user.put(username, adress);
	}
	
	public void remove(String username){
		chat_user.remove(username);
	}
	
	public Map<String, String> get_user_list(){
		return chat_user;
	}
	
	public int get_user_list_size(){
		return chat_user.size();
	}
	
	public Set<String> key_set(){
		return chat_user.keySet();
	}
	
	public String get_val(String key){
		return chat_user.get(key);
	}

	public boolean has_user(String ip, String user) {
		return (chat_user.containsKey(ip) && chat_user.get(ip).equals(user));
	}
	

}
